function rot13(str) {
    // LBH QVQ VG!
    const strArr = [];
    for (let i = 0; i < str.length; i++) {
        let num = str[i].charCodeAt(0);
        if (num >= 65 && num <= 77) num = num + 13;
        else if (num > 77 && num < 91) num = num - 13;
        strArr.push(String.fromCharCode(num));
    }
    return strArr.join("");
}

// Change the inputs below to test
rot13("SERR PBQR PNZC");
